<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/13
 * Time: 19:41
 */

namespace App\HttpController;

use Sslh\Auth\AuthComponent;
use EasySwoole\Component\Pool\PoolManager;
use App\Utility\Pool\RedisPool;

class Auth extends  BaseController
{

    public function  login()
    {
        $phone = '123';
        $passwd = '123';

        $auth_component = new AuthComponent();
        $result = $auth_component->login($phone, $passwd);

        $redis = PoolManager::getInstance()->getPool(RedisPool::class)->getObj();
        $redis->set('key', 'nihao');
        $data = $redis->get('key');
        PoolManager::getInstance()->getPool(RedisPool::class)->recycleObj($redis);
        $this->response()->write($data);

        //var_dump($result);
        return $this->response()->write($result);

    }

    public function test()
	{
	return $this->response()->write('a');
	}

}

